<template>
  <div>
    <div style="background: #e8f1f8">
      <div class="det_tab">
        <div class="det_tab_item">
          <eagle-cell-group :border="border">
            <eagle-input
              name="CheckTypeName"
              label="证书类型"
              v-model="form.CertTypeName"
              readonly
            />
            <eagle-input
              name="calendar"
              v-model="form.CertCode"
              label="证书编号"
              readonly
            />
            <eagle-input
              name="calendar"
              v-model="form.CertName"
              label="证书名称"
              readonly
            />
            <eagle-input
              name="calendar"
              v-model="form.ChnName"
              label="所属员工"
              readonly
            />
            <eagle-input
              name="calendar"
              v-model="form.ManagerName"
              label="证书管理员"
              readonly
            />
            <eagle-input
              name="calendar"
              v-model="form.CertOrg"
              label="发证机构"
              readonly
            />
            <eagle-input
              label="发证日期"
              :value="form.PublishDate | formatDate"
              readonly
            />
            <eagle-input
              label="是否需要复检"
              :value="form.IsNeedReview?'是':'否'"
              readonly
            />
            <eagle-input
              label="最近复审日期"
              :value="form.ReviewDate  | formatDate"
              readonly
            />
            <eagle-input
              label="下次复审日期"
              :value="form.NextReviewDate  | formatDate"
              readonly
            />
            <FileUpload
              :attachs="form.Attachs"
              :labelName="'证书附件'"
              :allowEdit="false"
            />
            <eagle-input
              label="公司保存原件"
              :value="form.OriginalScript?'是':'否'"
              readonly
            />
          </eagle-cell-group>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getDate } from "@/utils/getDate";
// import { deepClone } from "@/utils";
export default {
  components: {},
  data() {
    return {
      baseUrl: process.env.VUE_APP_BASE_API,
      id: this.$route.query.id,
      border: false,
      form: {},
      total: 0,
      show: false,
      PlanTypeName: "无",
    };
  },
  created() {
    this.geDetail();
    console.log("created");
  },
  filters: {
    formatDate: function (value, args) {
      return getDate(value);
    },
  },
  activated() {
    console.log("activated");
  },
  methods: {
    // 获取详情
    geDetail() {
      let _this = this;
      _this.$axios
        .get("/SiteCert/GetDetail", { params: { id: this.id } })
        .then((res) => {
          _this.form = res.data;
          _this.form.EffectDate = getDate(res.data.EffectDate);
          //比较预案类型 获取 类型名称
          if (res.data.CertTypeList && res.data.CertTypeList.length > 0) {
            res.data.CertTypeList.forEach((element) => {
              if (element.ID == res.data.CertType) {
                _this.form.CertTypeName = element.Name;
              }
            });
          }
        });
    },
    getDate1(value) {
      var ss=getDate(value)
      console.log(ss)
      return getDate(value);
    },
  },
};
</script>f

<style lang="less">
</style>
